package server;

import java.rmi.Remote;
import java.rmi.RemoteException;
import java.sql.SQLException;

import client.Trader;

import common.InsufficientFundsException;
import common.Item;
import common.ItemList;
import common.NameOccupiedException;

public interface Marketplace extends Remote {
	public void shutdownMarketplace() throws RemoteException,SQLException;
	public int getItemsBought(String name) throws RemoteException,SQLException;
	public int getItemsSold(String name) throws RemoteException,SQLException;
	public void replaceTrader(Trader trader) throws RemoteException,SQLException;
	public boolean login(String username, String password) throws RemoteException,SQLException;
	public void logout(String username) throws RemoteException,SQLException;
	public void registerTrader(Trader trader) throws NameOccupiedException, RemoteException,SQLException;
	public ItemList getItems() throws RemoteException,SQLException;
	public boolean buyItem(Item item,String traderName) throws InsufficientFundsException, RemoteException,SQLException;
	public void sellItem(Item item) throws RemoteException,SQLException;
	public void watchForItem(String itemName, float maxPrice, String traderName) throws RemoteException,SQLException;
	public float getAccountBalance(String traderName) throws RemoteException;
	public void depositToAccount(String traderName, float balance) throws RemoteException;
	public boolean traderNameAvailable(String traderName) throws RemoteException, SQLException;
}